import 'package:dynamic_forms/dynamic_forms.dart';

import 'multiple_input.dart';

class MultipleInputParser extends ElementParser<DyMultipleInput> {
  @override
  String get name => "multiple_input";

  @override
  DyMultipleInput parse(
      ParserNode parserNode, FormElement parent, ElementParserFunction parser) {
    var radio = DyMultipleInput();
    radio.fillMultipleInput(
      id: parserNode.getPlainStringValue("id"),
      isVisible: parserNode.getIsVisible(),
      parent: parserNode.getParentValue(parent),
      placeHolder: parserNode.getStringValue(DyMultipleInput.placeHolderPropertyName),
      title: parserNode.getStringValue(DyMultipleInput.titlePropertyName),
      attribute: parserNode.getStringValue(DyMultipleInput.attributePropertyName),
      maxInput: parserNode.getIntValue(DyMultipleInput.maxInputPropertyName),
    );
    return radio;
  }
}
